package com.sun.clients.task;

import com.sun.clients.service.MessageService;
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecords;

@Slf4j
public class MessageTask implements Runnable {

    private MessageService messageService;
    private ConsumerRecords<String, String> records;

    public MessageTask(MessageService messageService, ConsumerRecords<String, String> records) {
        this.messageService = messageService;
        this.records = records;
    }

    @Override
    public void run() {
        messageService.saveMessage(records);
    }

}
